package 实验四;

public class Test {
	public static double LatestNationalWageTaxStandard(double salary) {
        double tax = 0;
        try {
            if (0 <= salary && salary <= 5000) {
                tax = 0;
            }
            if (5000 < salary && salary <= 8000) {
                tax = salary * 0.03;
            }
            if (8000 < salary && salary <= 17000) {
                tax = salary * 0.10;
            }
            if (17000 < salary && salary <= 30000) {
                tax = salary * 0.20;
            }
            if (30000 < salary && salary <= 40000) {
                tax = salary * 0.25;
            }

        } catch (Exception e) {
            System.out.println("金额有误");
        }
        final double tax1 = tax;
        return tax1;
    }

    public static void SplitLine() {
        for (int i = 1; i < 45; i++) {
            System.out.print("——");
        }
        System.out.println();
    }

    public static void main(String[] args) {
        String List1[] = { "perfefct", "good", "bad", "perfefct", "perfefct", "good", "good", "good", "bad", "good", "good", "you", "perfefct", "good", "good", "youperfefct","good", "good" };
        String List2[] = { "good", "good", "good", "perfefct", "good", "good", "perfefct", "good", "bad", "perfefct", "perfefct", "perfefct", "perfefct","perfefct", "bad", "perfefct", "perfefct", "perfefct" };
        String List3[] = {"perfefct","perfefct","good","good","perfefct","perfefct","good","bad","perfefct","bad","perfefct","good","good","good","perfefct","perfefct","good","good"};

        Lab lab1 = new Lab("计算机网络实验室", 1, List1);
        Lab lab2 = new Lab("组成原理实验室", 2, List2);
        Lab lab3 = new Lab("物理实验室", 3, List3);

        Lab moren1[] = new Lab[5];
        Lab moren2[] = new Lab[5];
        
        Student std1 = new Student("student1", moren1, 0);
        Student std2 = new Student("student2", moren2, 0);

        std1.setlaboratory(0, moren1, lab1);
        std1.setlaboratory(1, moren1, lab2);
        std2.setlaboratory(2, moren2, lab3);


        std1.WorkStudyIncome(lab1.getscore(), std1);
        std1.WorkStudyIncome(lab2.getscore(), std1);
        std2.WorkStudyIncome(lab3.getscore(), std2);


        System.out.println("欢迎使用学生实验室勤工俭学模拟系统");

        System.out.println("student1负责丨" + std1.getlaboratory()[0].getlabname() + "丨以及丨"
                + std1.getlaboratory()[1].getlabname() + "丨");

        System.out.println("丨" + std1.getlaboratory()[0].getlabname() + "丨18周检查结果如下:");

        for (int t = 0; t < 18; t++) {
            System.out.print(std1.getlaboratory()[0].getscore()[t] + " ");
        }
        System.out.println();

        System.out.println("丨" + std1.getlaboratory()[1].getlabname() + "丨18周检查结果如下:");

        for (int t = 0; t < 18; t++) {
            System.out.print(std1.getlaboratory()[1].getscore()[t] + " ");
        }
        System.out.println();

        System.out.println("纳税前收入为" + std1.getmoney() + "元。");

        std1.losemoney(LatestNationalWageTaxStandard(std1.getmoney()));
        System.out.println("税收后收入为" + std1.getmoney() + "元。");

        System.out.println("student2负责丨" + std2.getlaboratory()[2].getlabname() + "丨");

        System.out.println("丨" + std2.getlaboratory()[2].getlabname() + "丨18周检查结果如下:");

        for (int t = 0; t < 18; t++) {
            System.out.print(std2.getlaboratory()[2].getscore()[t] + " ");
        }
        System.out.println();

        

        System.out.println("纳税前收入为" + std2.getmoney() + "元。");

        std2.losemoney(LatestNationalWageTaxStandard(std2.getmoney()));
        System.out.println("税收后收入为" + std2.getmoney() + "元。");

    }
}